package dbexp.model;

import static dbexp.model.db.DbOT.ERROR;
import static dbexp.model.db.DbOT.ERRORS;

public class Error extends DbObject {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	public static final String LABEL = "błędy";
	public static final String DEF_ICON = "db-error-icon";
	public String otype = "";
	public int sequence = 0;
	public int line = 0;
	public int position = 0;
	public String text = "";

	public Error() {
		super(LABEL, ERRORS);
		setIcons(DEF_ICON);
	}

	public Error(String name) {
		super(name, ERROR);
		setIcons(DEF_ICON);
		set("leaf", true);
	}

	public Error(String name, String schema) {
		this(name);
		setSchema(schema);
	}

	public String getOType() {
		return otype;
	}

	public void setOType(String otype) {
		this.otype = otype;
	}

	public int getSequence() {
		return sequence;
	}

	public void setSequence(int sequence) {
		this.sequence = sequence;
	}

	public int getLine() {
		return line;
	}

	public void setLine(int line) {
		this.line = line;
	}

	public int getPosition() {
		return position;
	}

	public void setPosition(int position) {
		this.position = position;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public void setSchema(String schema) {
		set("schema", schema);
	}

	public String getSchema() {
		return get("schema");
	}

	public String getQuery(int operation) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toString() {
		return getText();
	}
}
